using Castle.ActiveRecord;
using Iesi.Collections.Generic;

namespace WineCellar.Tests.Model
{
	[ActiveRecord]
	public class Company
	{
		private int id;
		private string name;
		private ISet<Company> companies = new HashedSet<Company>();

		[PrimaryKey(PrimaryKeyType.Identity)]
		public virtual int Id
		{
			get { return id; }
			set { id = value; }
		}

		[Property]
		public virtual string Name
		{
			get { return name; }
			set { name = value; }
		}
		[HasAndBelongsToMany(typeof(Company), ColumnRef = "ParentId", ColumnKey = "ChildId", Table = "Company2Company")]
		public virtual ISet<Company> Companies
		{
			get { return companies; }
			set { companies = value; }
		}
	}
}
